﻿using Pay.DTO;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.IService {
    /// <summary>
    /// 集市订单
    /// </summary>
    public interface ITokenBazaarOrderService {
        /// <summary>
        /// 创建订单
        /// </summary>
        /// <param name="productId"></param>
        /// <param name="merchantId"></param>
        /// <param name="shipAddressId"></param>
        /// <returns></returns>
        bool CreateOrder(long productId, long merchantId, long shipAddressId);
        /// <summary>
        ///集市订单
        /// </summary>
        /// <param name="productId"></param>
        /// <param name="merchantId"></param>
        /// <param name="shipAddressId"></param>
        /// <param name="wxOpenId"></param>
        /// <param name="ip"></param>
        /// <returns></returns>
        mall_model ValidateOrder(long productId, long merchantId, long shipAddressId, string wxOpenId, string ip);
        /// <summary>
        /// 查询订单
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        token_bazaar_order_dto Get(long id);
        /// <summary>
        /// 订单查询
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedResult<token_bazaar_order_dto> Gets(BazaarOrderQuery query);
        /// <summary>
        /// 删除订单
        /// </summary>
        /// <param name="id"></param>
        /// <param name="merchantId"></param>
        /// <param name="type">1 买家 2 卖家</param>
        /// <returns></returns>
        bool Delete(long id, long merchantId, int type);
        /// <summary>
        /// 卖家取消订单
        /// </summary>
        /// <param name="id"></param>
        /// <param name="merchantId"></param>
        /// <returns></returns>
        bool Cancle(long id, long merchantId);
        /// <summary>
        /// 系统取消订单
        /// </summary>
        /// <param name="id"></param>
        /// <param name="sysUserId"></param>
        /// <returns></returns>
        bool SysCancle(long id, long sysUserId);
        /// <summary>
        /// 买家收货
        /// </summary>
        /// <param name="id"></param>
        /// <param name="merchantId"></param>
        /// <returns></returns>
        bool Receive(long id, long merchantId);
        /// <summary>
        /// 系统确认收货
        /// </summary>
        /// <param name="id"></param>
        /// <param name="sysUserId"></param>
        /// <returns></returns>
        bool SysReceive(long id, long sysUserId);
        /// <summary>
        /// 系统自动收货(7天后)
        /// </summary>
        /// <returns></returns>
         Task<int> SysTaskRecevie();
        /// <summary>
        /// 卖家发货
        /// </summary>
        /// <param name="shipModel"></param>
        /// <returns></returns>
        bool Deliver(TokenBazaarOrderShipModel shipModel);
    }
}
